package com.atguigu.lease.web.admin.schedule;

import com.atguigu.lease.web.admin.service.LeaseAgreementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.sql.SQLOutput;
@Component
public class ScheduledTasks {
    Long count = 0L;
    @Autowired
    private LeaseAgreementService leaseAgreementService;

    @Scheduled(cron = "* * 1 * * ?")
    public void updateLeaseStatus() {
        count++;
        System.out.println("**********第" + count + "次执行*************");
        leaseAgreementService.updateStatus();
    }
}
